package com.fs.book.service;

import com.fs.book.entity.Book;
import com.fs.book.entity.User;
import com.fs.book.vo.BookVO;
import com.github.pagehelper.Page;

import java.util.List;

public interface BookService {
    /**
     * 根据主键查询
     * @param bid
     * @return
     */
    Book queryById(Integer bid)throws  Exception;

    /**
     * 添加
     * @param book
     * @return
     */
    boolean addBook(Book book)throws  Exception;

    List<Book> queryAll() throws  Exception;

    /**
     * 分页查询
     * @param bookVO
     * @return
     */
    Page<Book>  queryByPage(BookVO bookVO)throws  Exception;

    // 购物车方法...
    void addToCart(Book book, Integer quantity, User currentUser);

}



